Home:ALL Converter>Why am I getting "bind source path does not exist" from Docker on Windows in Windows Subsystem for Linux?

Why am I getting "bind source path does not exist" from Docker on Windows in Windows Subsystem for Linux?

Ask Time:2019-02-04T18:08:02         Author:urig

Json Formatter

I have a docker-compose.yml file where I'm mounting a volume with bind like so:

version: '3.3'
services:
  backend:
    image: gitlab:5000/foo/bar/backend:${CI_COMMIT_SHA}
    volumes:
      - type: bind
        source: ../backend
        target: /var/www/html
      - type: bind
        source: ../backend
        target: /var/envs
    environment:
      SRV_ENV: 'development'

In the Windows Subsystem for Linux (Ubuntu) bash shell I cd to /home/urig/src/foo/bar/deploy.

When I then run :

docker-compose -f docker-compose.yml down

I get the following error:

starting server...
Creating network "deploy_default" with the default driver
Creating deploy_backend_1    ... error
ERROR: for deploy_backend_1  Cannot create container for service backend: invalid mount config for type "bind": bind source path does not exist: /home/urig/src/foo/bar/backend

ERROR: for backend  Cannot create container for service backend: invalid mount config for type "bind": bind source path does not exist: /home/urig/src/foo/bar/backend
ERROR: Encountered errors while bringing up the project.
ERROR: No container found for backend_1

Why can't WSL find the source folder and how can I fix this?

I am using Docker Desktop (for Windows) CE v2.0.0.2. Docker Engine v18.09.1, docker-compose v1.23.2

Author:urig,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54513865/why-am-i-getting-bind-source-path-does-not-exist-from-docker-on-windows-in-win
yy